package com.ruoyi.weixin.Exception;

import com.ruoyi.weixin.entity.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class ExeceptionAdvce {

    @ExceptionHandler(Exception.class)
    public R<?> error(Exception e){
        log.error("[Buss异常处理]======>,msg:{}",e.getMessage());
        return R.error(e.getMessage());
    }

    @ExceptionHandler(BussnissExecption.class)
    public R<?> BussnessException(BussnissExecption e){
        log.error("afhnjnhbgv",e.getCodeMsg());
        return R.error(e.getMessage());
    }
}